﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using FM.Common;
using FM.Events;
using FM.录音.Events;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.Mvvm;
using Microsoft.Practices.Prism.PubSubEvents;

namespace FM.录音.ViewModels
{
    public class 选项命令ViewModel : BindableBase
    {
        private readonly IEventAggregator 新闻部;
        public 选项命令ViewModel(IEventAggregator 新闻部cs)
        {
            新闻部 = 新闻部cs;
            确定Command = new DelegateCommand<object>(确定Action);
            取消Command = new DelegateCommand<object>(取消Action);
        }

        private void 取消Action(object obj)
        {
            新闻部.GetEvent<选项取消Event>().Publish(null);
        }

        private void 确定Action(object obj)
        {
            新闻部.GetEvent<保存配置Event>().Publish(null);

            新闻部.GetEvent<选项确定Event>().Publish(null);
        }

        public ICommand 确定Command { get; set; }
        public ICommand 取消Command { get; set; }

    }

}
